import axios from 'axios'
import { BASE_URL, API } from '../config'

// 创建axios实例
const request = axios.create({
  baseURL: BASE_URL,
  timeout: 5000
})

export const errorCodeApi = {
  // 获取错误代码列表
  getErrorList() {
    return request.get(API.ERRORS)
  },
  
  // 搜索错误代码
  searchError(keyword) {
    return request.get(`${API.ERRORS}search/${keyword}`)
  },
  
  // 获取特定错误代码详情
  getErrorDetail(errorCode) {
    return request.get(`${API.ERRORS}${errorCode}`)
  }
} 